package com.atguigu.tingshu.album.service;

import com.atguigu.tingshu.model.album.TrackInfo;
import com.atguigu.tingshu.query.album.TrackInfoQuery;
import com.atguigu.tingshu.vo.album.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

public interface TrackInfoService extends IService<TrackInfo> {

    void saveTrackInfo(TrackInfoVo trackInfoVo,Long userId);

    /**
     * 保存声音统计信息
     * @param trackId 声音ID
     * @param statType 统计类型
     * @param statNum 统计数值
     */
    void saveTrackStat(Long trackId, String statType, int statNum);

    Page<TrackListVo> findUserTrackPage(Page<TrackListVo> page1, TrackInfoQuery trackInfoQuery);

    TrackInfo getTrackInfo(Long id, Long userId);

    void updateTrackInfo(Long id, TrackInfo trackInfo, Long userId);

    void removeTrackInfo(Long id);

    Page<AlbumTrackListVo> findAlbumTrackPage(Long albumId, Page<AlbumTrackListVo> voPage,Long userId);

    /**
     * 获取声音统计信息
     * @param trackId
     * @return
     */
    TrackStatVo getTrackStatVo(Long trackId);

    void updateTrackStat(TrackStatMqVo mqVo);

    /**
     * 基于选择购买声音ID作为起始获取指定数量未购买声音列表
     *
     * @param trackId
     * @param trackCount
     * @return
     */
    List<TrackInfo> findPaidTrackInfoList(Long userId, Long trackId, Integer trackCount);

    List<Map<String, Object>> findUserTrackPaidList(Long userId, Long trackId);
}
